<?php
class Session extends WebService_base{
	var $sid, $sname;
	/**
	 * Constructor
	 *   
	 */
	function __construct(){
		parent::__construct();
		if($this->ws_get_config()){
			$this->sessionStart();
		}
	}
	
	function sessionStart(){
		$this->sname = session_name('ws_freeway');
		if(isset($_COOKIE['ws_freeway'])){
			$this->sid = session_id($_COOKIE['ws_freeway']);
		}
		if(isset($_SESSION['cart']['customer_id'])){
			$this->sid = session_id("customer_".$_SESSION['cart']['customer_id']);
		}
		session_start();		
		$this->sid = session_id();
		if(isset($_COOKIE['customer_id'])){
			$_SESSION['cart']['customer_id'] = $_COOKIE['customer_id'];
			$_SESSION['customer_id'] = $_COOKIE['customer_id'];
		}
	}

	/**
	 * Enter description here...
	 *
	 * @return string
	 */
	function returnSID(){
		return $this->sid;
	}
	
	/**
	 * Enter description here...
	 *
	 * @param string $data
	 * @param string $name
	 * @return mixed
	 */
	function SetValue($data, $name){
		$_SESSION[$name] = $data;
		//return $_SESSION;
	}
	
	/**
	 * Enter description here...
	 *
	 * @param string $name
	 * @return mixed
	 */
	function GetValue($name){
		return array($_SESSION[$name]);
	}
	
}
?>